home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
HELP_UTL
/
COLLMA
/
GENHLP.INT
< prev
next >
Wrap
Text File
|
1994-04-16
|
3KB
|
81 lines
UNIT GenHlp; {--- Registration values between 2061..2080 ---}
INTERFACE
TYPE
PCollEntry = ^TCollEntry;
TCollEntry = record
DisplayText: PString; {- text to be displayed in ListBox -}
lineText : PString; {- text to be returned in associated line -}
UserVal : Pointer; {- User information; -}
UserSize : word; {- SizeOf structure pointed by 'UserVal' -}
isTagged : boolean; {- TRUE if this item is toggled on -}
end;
{--- A collection of 'TCollEntry' ---}
PHlpCollection = ^THlpCollection;
THlpCollection = object(TSortedCollection)
FUNCTION Compare(Key1, Key2: Pointer): Integer; virtual;
PROCEDURE FreeItem(Item: Pointer); virtual;
FUNCTION GetItem(VAR S: TStream): Pointer; virtual;
PROCEDURE PutItem(VAR S: TStream; Item: Pointer); virtual;
end;
CollFunc = FUNCTION: PHlpCollection;
HlpRecType = record
HlpRec: record
aCollList: PHlpCollection; {collection itself}
aListPos : word; {position of selected element}
end;
allowToggle: boolean;
aCollFunc : CollFunc; {pointer to the function which creates
the collection}
end;
{--- 'TGlobalHlp' can be use directly in dialog boxes ---}
PGlobalHlp = ^TGlobalHlp;
TGlobalHlp = object(TSortedListBox)
useList: boolean;
sendMsg: boolean;
oldFoc: integer;
CONSTRUCTOR Init(VAR Bounds: TRect; ANumCols: Word; AsendMsg: boolean;
AScrollBar: PScrollBar);
CONSTRUCTOR Load(VAR S: TStream);
PROCEDURE GetData(VAR Rec); virtual;
FUNCTION GetKey(VAR S: String): Pointer; virtual;
FUNCTION GetText(Item: Integer; MaxLen: Integer): String; virtual;
FUNCTION IsSelected(Item: Integer): Boolean; virtual;
PROCEDURE HandleEvent(VAR Event: TEvent); virtual;
FUNCTION DataSize: Word; virtual;
PROCEDURE SetData(VAR Rec); virtual;
PROCEDURE Store(VAR S: TStream);
DESTRUCTOR Done; virtual;
end;
{--- 'THlpView' can be attached to an 'ImputLine' with an up arrow icon;
will display a pickup collection ---}
PHlpView = ^THlpView;
THlpView = object(TView)
LineLink : PInputLine;
HelpTitle: TTitleStr;
wViewHlp : HlpRecType;
wColPtr : PCollEntry;
CONSTRUCTOR Init(VAR Bounds: TRect;
VAR wHlpView: HlpRecType;
HlpTitle: TTitleStr;
ALink: PInputLine);
CONSTRUCTOR Load(VAR S: TStream);
DESTRUCTOR Done; virtual;
PROCEDURE Draw; virtual;
PROCEDURE HandleEvent(VAR Event: TEvent); virtual;
FUNCTION GetPalette: PPalette; virtual;
PROCEDURE GetCollElement(VAR CollEntry: TCollEntry); virtual;
PROCEDURE Store(VAR S: TStream);
end;
PROCEDURE RegisterGenHlp;
IMPLEMENTATION